﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;
using WordService.Business.IBLL;
using System.Reflection;

namespace WordService.Business
{
    public sealed class BLLManager
    {
        private static readonly String DLLPath = ConfigurationManager.AppSettings["DLLPath"];

        private BLLManager() { }

        public static IArticleBLL CreateArticleBLL()
        {
            String className = DLLPath + ".Business.BLL.ArticleBLL";
            return (IArticleBLL)Assembly.Load(DLLPath).CreateInstance(className);
        }

        public static IInstitutionBLL CreateInstitutionBLL()
        {
            String className = DLLPath + ".Business.BLL.InstitutionBLL";
            return (IInstitutionBLL)Assembly.Load(DLLPath).CreateInstance(className);
        }

        public static IAuthorBLL CreateAuthorBLL()
        {
            String className = DLLPath + ".Business.BLL.AuthorBLL";
            return (IAuthorBLL)Assembly.Load(DLLPath).CreateInstance(className);
        }

        public static IKeywordBLL CreateKeywordBLL()
        {
            String className = DLLPath + ".Business.BLL.KeywordBLL";
            return (IKeywordBLL)Assembly.Load(DLLPath).CreateInstance(className);
        }

        public static IFileBLL CreateFileBLL()
        {
            String className = DLLPath + ".Business.BLL.FileBLL";
            return (IFileBLL)Assembly.Load(DLLPath).CreateInstance(className);
        }
    }
}
